import requests
from bs4 import BeautifulSoup as bs
import urllib3

header = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0'
}

def getUrl():
    url = r'https://www.susu96.com'
    response = requests.get(url,headers=header)
    print(response.url)
    tp_url = response.url[:-16]
    return tp_url

def getAllUri(url):

    uri = "index/home.html"
    response = requests.get(url + uri)
    soup = bs(response.text, 'lxml')
    all_uri = soup.find_all('li', attrs={'class': 'item'})
    # print(all_uri)
    all_uri_list = []
    for item in all_uri:
        a_tag = item.find('a')
        if a_tag.has_attr('href'):
            #         print (item)
            all_uri_list.append(a_tag['href'])
    vip_uri_list = all_uri_list[0:8]
    online_uri_list = all_uri_list[8:16]
    phone_uri_list = all_uri_list[16:24]
    picture1_uri_list = all_uri_list[24:32]
    picture2_uri_list = all_uri_list[32:40]
    novel_uri_list = all_uri_list[40:48]
    return vip_uri_list,online_uri_list,phone_uri_list,picture1_uri_list,picture2_uri_list,novel_uri_list

url = getUrl()
__,__,__,picture_uri,__,__ = getAllUri(url)
for item in picture_uri:
    print(url[:-1]+item)